Fix le_read64 to not actually be le_read56.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 12 Jun 2003 20:17:37 +0000 (20:17 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 12 Jun 2003 20:17:37 +0000 (20:17 +0000)
Easygps: use it when writing coords.

gpsbabel/easygps.c
gpsbabel/util.c

index c9d5ad333084ec475dd248d5fe1d295ec02b4904..efc67172ed278f264bae8fb740a04adfff6c663f 100644 (file)
@@ -211,6 +211,7 @@ write_pstring(const char *p)
 static void
 ez_disp(const waypoint *wpt)
 {
+       char tbuf[8];
        fprintf(file_out, "W", 0xb);
        if (wpt->shortname) {
                fputc(1, file_out);
@@ -225,9 +226,11 @@ ez_disp(const waypoint *wpt)
                write_pstring(wpt->icon_descr);
        }
        fputc(0x63, file_out);
-       fwrite(&wpt->position.latitude.degrees, 8, 1, file_out);
+       le_read64(tbuf, &wpt->position.latitude.degrees);
+       fwrite(tbuf, 8, 1, file_out);
        fputc(0x64, file_out);
-       fwrite(&wpt->position.longitude.degrees, 8, 1, file_out);
+       le_read64(tbuf, &wpt->position.longitude.degrees);
+       fwrite(tbuf, 8, 1, file_out);
        if (wpt->notes) {
                fputc(5, file_out);
                write_pstring(wpt->notes);
index 06656b4e0c3fea952e68e07a38980aadd416a2da..964d34376cfbf6aabed6133aef9368ed6598391d 100644 (file)
@@ -332,7 +332,7 @@ le_read64(void *dest, void *src)
                memcpy(dest, src, 8);
        } else {
                int i;
-               for (i = 0; i < 7; i++) {
+               for (i = 0; i < 8; i++) {
                        cdest[i] = csrc[7-i];
                }
        }